#include "widget.h"
#include "ui_widget.h"

int a=1;
Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
    pix.load(":/new/prefix1/1.jpeg");
    ui->label->setPixmap(pix);
    ui->label->setScaledContents(true);

}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pushButton_clicked()
{
    if(a==10){
           a=1;
           pix.load(":/new/prefix1/"+QString::number(a) +".jpeg");
           ui->label->setPixmap(pix);
           ui->label->setScaledContents(true);
           return;
       }
       a=a+1;

       pix.load(":/new/prefix1/"+QString::number(a) +".jpeg");
       ui->label->setPixmap(pix);
       ui->label->setScaledContents(true);


}

void Widget::on_pushButton_2_clicked()
{
    if(a==1){
            a=10;

            pix.load(":/new/prefix1/"+QString::number(a) +".jpeg");
            ui->label->setPixmap(pix);
            ui->label->setScaledContents(true);
            return;
        }
        a=a-1;

        pix.load(":/new/prefix1/"+QString::number(a) +".jpeg");
        ui->label->setPixmap(pix);
        ui->label->setScaledContents(true);
}

void Widget::on_pushButton_3_clicked()
{
    this->hide();
    Form *f=new Form();
    f->show();
}
